package com.memoryangelapplication.services;
/*
 * Check Network Availability*/
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

public class NetworkUtility {
	public static Boolean isNetWorking(Context context) {
		try {

			ConnectivityManager ConMgr = (ConnectivityManager) context
					.getSystemService(Context.CONNECTIVITY_SERVICE);
			if (ConMgr.getNetworkInfo(ConnectivityManager.TYPE_WIFI).getState() == NetworkInfo.State.CONNECTED
					|| ConMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE)
							.getState() == NetworkInfo.State.CONNECTED)
				return true;

			else
				return false;

		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}

	}
}
